package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.ForumFansPostService;
import com.ai.web.vo.ForumFansPostV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.ForumFansPost;
import com.tiny.persistence.repository.ForumFansPostRepo;

@Service
public class ForumFansPostServiceImpl extends BaseServiceImpl<ForumFansPost, Integer, ForumFansPostV> implements ForumFansPostService  {

    @Autowired
    private ForumFansPostRepo forumFansPostRepo;
    
    @Autowired
    public ForumFansPostServiceImpl(ForumFansPostRepo forumFansPostRepo) {
        super(forumFansPostRepo);
    }

    public ForumFansPostV getForumFansPost(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveForumFansPost(ForumFansPostV forumFansPostV) throws Exception {
        
        ForumFansPostV saveV = saveT(forumFansPostV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteForumFansPosts(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
